/*
 * 类名称:AdminCustomerService.java
 * 包名称:com.unimall.graded.admin.api.customer
 *
 * 修改履历:
 *     日期                       修正者        主要内容
 *     2020-03-17 09:33:10        lin     初版做成
 *
 * Copyright (c) 2019-2019 浵浵科技
 */
package com.unimall.graded.admin.api.customer;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.annotation.param.Range;
import com.iotechn.unimall.core.exception.ServiceException;
import com.unimall.graded.data.domain.CustomerDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;
import java.util.Map;

/**
 * Admin分销用户Service接口
 *
 * @author lin
 * @date 2020-03-17 09:33:10
 */

@HttpOpenApi(group = "graded.admin.customer", description = "分销用户")
public interface AdminCustomerService {

    @HttpMethod(description = "创建", permission = "graded:customer:create", permissionParentName = "分销管理", permissionName = "分销用户管理")
    public Integer create(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "customerDO", type = HttpParamType.COMMON, description = "分销用户信息") CustomerDO customerDO) throws ServiceException;


    @HttpMethod(description = "删除", permission = "graded:customer:delete", permissionParentName = "分销管理", permissionName = "分销用户管理")
    public Boolean delete(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "分销用户Id") Long id) throws ServiceException;


    @HttpMethod(description = "修改", permission = "graded:customer:update", permissionParentName = "分销管理", permissionName = "分销用户管理")
    public Boolean update(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "customerDO", type = HttpParamType.COMMON, description = "分销用户信息") CustomerDO customerDO) throws ServiceException;


    @HttpMethod(description = "详情", permission = "graded:customer:info", permissionParentName = "分销管理", permissionName = "分销用户管理")
    public CustomerDO info(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "分销用户Id") Long id) throws ServiceException;

    /**
     * 分页查询
     */
    @HttpMethod(description = "查询", permission = "graded:customer:list", permissionParentName = "分销管理", permissionName = "分销用户管理")
    public Page<CustomerDO> list(
        @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
        @HttpParam(name = "id", type = HttpParamType.COMMON, description = "客户id") Long id,
        @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "unimall的用户id") Long userId,
        @HttpParam(name = "parentId", type = HttpParamType.COMMON, description = "上级用户id（本表的id）") Long parentId,
        @HttpParam(name = "realname", type = HttpParamType.COMMON, description = "真实姓名") String realname,
        @Range(min = 1) @HttpParam(name = "page", type = HttpParamType.COMMON, description = "当前页码") Integer pageNo,
        @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度") Integer limit) throws ServiceException;

}
